import { Type } from 'class-transformer';
import { IsNotEmpty } from 'class-validator';
import { BaseClass } from '../base';

export class TrainingInRotation extends BaseClass {
  @IsNotEmpty({ message: '该次会话的凭证不能为空！' })
  @Type(() => String)
  public tempUserId: string;

  @IsNotEmpty({ message: '用户唯一ID不能为空！' })
  @Type(() => String)
  public userId: string;

  @IsNotEmpty({ message: '登录用户的昵称不能为空！' })
  @Type(() => String)
  public nickname: string;

  @IsNotEmpty({ message: '用登录用户的头像url不能为空！' })
  @Type(() => String)
  public avatar: string;

  @IsNotEmpty({ message: '登录地点的ip不能为空！' })
  @Type(() => String)
  public ipAddr: string;

  public static transformerThis(m: {}) {
    return super.plainClass(TrainingInRotation, m);
  }
}
